<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

	<div id="editForProjectMilestoneFinishApply" class="easyui-window" title="审核项目节点完结申请" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:720px; height:410px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;">
				<form id="editForProjectMilestoneFinishApplyForm" method="post" action="checkProjectMilestoneFinishApply" style = "width:100%; height: 100%">
					<input type="hidden" id="projectMilestoneFinishApplyId" name = "id"/>
					<input type="hidden" id="projectMilestoneFinishApplyStatus" name = "status" value="3000"/>
					<input type="hidden" id="projectMilestoneFinishApplyProjectMilestoneId" name = "projectMilestone.id"/>
					<input type="hidden" id="projectMilestoneFinishApplyProjectMilestoneStatus" name = "projectMilestone.status" value="9000"/>
					<table>
						<tr>
							<td width="100px;" align="right">项目名称：</td>
							<td width="160px">
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyProjectName" style="width: 200px;" />
							</td>
							<td width="100px;" align="right">节点名称：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyProjectMilestoneName" style="width: 200px;" />							
							</td>
						</tr>
						<tr>
							<td align="right">申请人：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyApplyPersonName" style="width: 200px;" />							
							</td>
							<td align="right">申请时间：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" id="projectMilestoneFinishApplyApplyTime" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">申请说明：</td>
							<td colspan="3">
								<input class="easyui-textbox"  readonly="readonly" data-options="multiline:true" style="width: 510px; height: 120px;" id="projectMilestoneFinishApplyApplyDescription">
							</td>
						</tr>
					</table>
					<table id="lookProjectMilestoneQualityCheckStyle" style="display: none;">
						<tr>
							<td width="100px" align="right">质量检测人：</td>
							<td>
								<input class="easyui-textbox" id="lookProjectMilestoneQualityCheckPersonId" readonly="readonly" style="width: 200px;" />
							</td>
							<td width="100px" align="right">质量检测日期：</td>
							<td>
								<input class="easyui-datebox" readonly="readonly" id="lookProjectMilestoneQualityCheckDate" style="width: 200px;" />
							</td>
						</tr>
						<tr>
							<td align="right">结果录入日期：</td>
							<td>
								<input class="easyui-datebox" readonly="readonly" id="lookProjectMilestoneQualityCheckInputTime" style="width: 200px;" />
							</td>
							<td align="right">质量检测状态：</td>
							<td>
								<input class="easyui-textbox" readonly="readonly" id="lookProjectMilestoneQualityCheckStatus" style="width: 200px;" />
							</td>
						</tr>
						<tr>
							<td align="right">质量检测说明：</td>
							<td colspan="3">
								<input class="easyui-textbox" data-options="multiline:true" style="width: 510px; height: 80px;" readonly="readonly" id="lookProjectMilestoneQualityCheckDescription">
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td width="100px;" align="right">审核意见：</td>
							<td>
								<input class="easyui-textbox" data-options="multiline:true" style="width: 510px; height: 120px;" name="checkComment" id="projectMilestoneFinishApplyCheckComment" />
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editForProjectMilestoneFinishApplyForm').submit()" style="width:80px">通过</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#projectMilestoneFinishApplyStatus').val('2001');$('#projectMilestoneFinishApplyProjectMilestoneStatus').val('0055');$('#editForProjectMilestoneFinishApplyForm').submit();" style="width:80px">驳回</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editForProjectMilestoneFinishApply').window('close')" style="width:80px">关 闭</a>
			</div>
		</div>
	</div>

	<script type="text/javascript">
	function editForProjectMilestoneFinishApply(id){
		$.ajax({ url: "getProjectMilestoneFinishApply?id="+id, success: function(data){
			clearForm("editForProjectMilestoneFinishApplyForm", "editForProjectMilestoneFinishApply");
			
			var val = $.parseJSON(data);
			$("#projectMilestoneFinishApplyId").val(id);
			$("#projectMilestoneFinishApplyStatus").val("3000");
			$("#projectMilestoneFinishApplyProjectMilestoneId").val(val.projectMilestoneId);
			$("#projectMilestoneFinishApplyProjectMilestoneStatus").val("9000");
			$("#projectMilestoneFinishApplyProjectName").textbox("setValue",val.projectName);
			$("#projectMilestoneFinishApplyApplyPersonName").textbox("setValue",val.applyPersonName);
			$("#projectMilestoneFinishApplyApplyTime").textbox("setValue",val.applyTime);
			$("#projectMilestoneFinishApplyApplyDescription").textbox("setValue",val.applyDescription);
			$("#projectMilestoneFinishApplyProjectMilestoneName").textbox("setValue",val.projectMilestoneName);
			
			$("#lookProjectMilestoneQualityCheckPersonId").textbox("setValue", val.qualityCheckPersonName);
			$("#lookProjectMilestoneQualityCheckDate").textbox("setValue", val.qualityCheckDate);
			$("#lookProjectMilestoneQualityCheckInputTime").textbox("setValue", val.qualityCheckInputTime);
			$("#lookProjectMilestoneQualityCheckStatus").textbox("setValue", (val.qualityCheckStatus == 'Y')?"已检测":"未检测");
			$("#lookProjectMilestoneQualityCheckDescription").textbox("setValue", val.qualityCheckDescription);
			$("#lookProjectMilestoneQualityCheckStyle").css("display", (val.qualityCheckSign == "Y")?"block":"none");
		}});
	}
	
	$("#editForProjectMilestoneFinishApplyForm").form({
		onSubmit: function(){
			var isValid = $(this).form('validate');
			return isValid;	// 返回false将停止form提交 
	    },
		success:function(data){
			var val = $.parseJSON(data);
			if(val.success){
				$('#dg').datagrid('reload');
				bottomRight('提示', '修改成功！');
				$('#editForProjectMilestoneFinishApply').window('close');
			}else{
				$.messager.alert("提示", val.msg, "error");
			}
		}
	});
	</script>